using System.Text.Json.Serialization;

namespace Sage.CloudStorage.Qiniu.Models
{
    /// <summary>
    /// CDN URL刷新请求模型
    /// </summary>
    public class CdnUrlRefreshRequest
    {
        /// <summary>
        /// 要刷新的URL列表
        /// </summary>
        [JsonPropertyName("urls")]
        public List<string> Urls { get; set; } = new List<string>();
    }

    /// <summary>
    /// CDN 目录刷新请求模型
    /// </summary>
    public class CdnDirRefreshRequest
    {
        /// <summary>
        /// 要刷新的目录列表
        /// </summary>
        [JsonPropertyName("dirs")]
        public List<string> Dirs { get; set; } = new List<string>();
    }

    /// <summary>
    /// CDN URL预取请求模型
    /// </summary>
    public class CdnPrefetchRequest
    {
        /// <summary>
        /// 要预取的URL列表
        /// </summary>
        [JsonPropertyName("urls")]
        public List<string> Urls { get; set; } = new List<string>();
    }

    /// <summary>
    /// CDN带宽查询请求模型
    /// </summary>
    public class CdnBandwidthRequest
    {
        /// <summary>
        /// 域名列表，以分号分隔
        /// </summary>
        [JsonPropertyName("domains")]
        public string Domains { get; set; } = string.Empty;

        /// <summary>
        /// 开始日期，格式为yyyy-MM-dd
        /// </summary>
        [JsonPropertyName("startDate")]
        public string StartDate { get; set; } = string.Empty;

        /// <summary>
        /// 结束日期，格式为yyyy-MM-dd
        /// </summary>
        [JsonPropertyName("endDate")]
        public string EndDate { get; set; } = string.Empty;

        /// <summary>
        /// 时间粒度，可选值：5min、hour、day
        /// </summary>
        [JsonPropertyName("granularity")]
        public string Granularity { get; set; } = "hour";
    }

    /// <summary>
    /// CDN日志查询请求模型
    /// </summary>
    public class CdnLogListRequest
    {
        /// <summary>
        /// 日志日期，格式为yyyy-MM-dd
        /// </summary>
        [JsonPropertyName("day")]
        public string Day { get; set; } = string.Empty;

        /// <summary>
        /// 域名列表，以分号分隔
        /// </summary>
        [JsonPropertyName("domains")]
        public string Domains { get; set; } = string.Empty;
    }
}